package com.dotc.patterndemo.entity.Fruitt;

import android.util.Log;

import com.dotc.patterndemo.action.visit.Visit;
import com.dotc.patterndemo.entity.Fruit;

public class Apple implements Fruit {
    private int price = 100;

    public Apple() {
    }

    public Apple(int price) {
        this.price = price;
    }

    @Override
    public int price() {
        return price;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    @Override
    public void draw() {
        Log.d("LUO","苹果红富士");
    }

    @Override
    public int accept(Visit visit) {
        return visit.sell(this);//指针可以传递真实类型
    }
}
